﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace SemanticEx.Tests
{
	[TestClass]
	public class ParserTests
	{
		[TestMethod]
		public void Can_parse_single_parameter()
		{
			var square = LambdaParser.Parse("x => x ^ 2");
			Assert.AreEqual(25, square(5));
		}

		[TestMethod]
		public void Can_parse_multiple_parameters()
		{
			var power = LambdaParser.Parse("(x, y) => x ^ y");
			Assert.AreEqual(125, power(5, 3));
		}
	}
}
